package online.szlib.com.core.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

@Entity
@Table(name = "cartitems")
public class CartItem implements Serializable {

	private static final long serialVersionUID = -723512058586873239L;

	public CartItem() {}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "cartitemid", length = 10)
	private Long cartitemId;

	@Column(name = "uid", length = 10)
	private Integer userId;

	@Column(name = "bookid", length = 10)
	private Integer bookId;

	@Column(name="publisher", length = 256)
	private String publisher;
	
	@Column(name="pubdate", length = 16)
	private String pubDate;
	
	@Column(name="author", length = 256)
	private String author;
	
	@Column(name="booksize", length = 16)
	private String bookSize;
	
	@Column(name="bookisbn", length = 64)
	private String bookIsbn;
	
	@Column(name="bookpages")
	private Integer bookPages;
	
	@Column(name="created", nullable = false)
	@Temporal(TemporalType.TIMESTAMP)
	private Date createDate;
	
	@Column(name="amount", nullable = false)
	private String amount;
	
	@Column(name="ip_address")
	private Float ip_address;
	
	@Column(name="status", nullable = false)
	private Integer status;
	
	@Column(name="notes", length = 245)
	private String notes;

	public Long getCartitemId() {
		return cartitemId;
	}

	public void setCartitemId(Long cartitemId) {
		this.cartitemId = cartitemId;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public Integer getBookId() {
		return bookId;
	}

	public void setBookId(Integer bookId) {
		this.bookId = bookId;
	}

	public String getPublisher() {
		return publisher;
	}

	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}

	public String getPubDate() {
		return pubDate;
	}

	public void setPubDate(String pubDate) {
		this.pubDate = pubDate;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getBookSize() {
		return bookSize;
	}

	public void setBookSize(String bookSize) {
		this.bookSize = bookSize;
	}

	public String getBookIsbn() {
		return bookIsbn;
	}

	public void setBookIsbn(String bookIsbn) {
		this.bookIsbn = bookIsbn;
	}

	public Integer getBookPages() {
		return bookPages;
	}

	public void setBookPages(Integer bookPages) {
		this.bookPages = bookPages;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getAmount() {
		return amount;
	}

	public void setAmount(String amount) {
		this.amount = amount;
	}

	public Float getIp_address() {
		return ip_address;
	}

	public void setIp_address(Float ip_address) {
		this.ip_address = ip_address;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getNotes() {
		return notes;
	}

	public void setNotes(String notes) {
		this.notes = notes;
	}

	public String toString() {
        return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }
}
